<?php
/**
 * <b>RUBIK IT Solution & Development ltd.</b>
 *
 * PROJECT		: Rubik Ultimate Framework
 * @version 	: 1.1
 * COPYRIGHT    : 2008
 * ------------------------------------------------------
 * 
 * Created on	:  Jun 27, 2008
 * 
 */

// no direct access
defined ( '_FW_EXEC' ) or die ( 'Restricted access' );

RCoreImporter::cls( "access.UserAccessFactory" );

/**
 * Define the group struct from the top to the leaf.
 * NOTE: The parent node has all access right of the children node
 * 
 * 	Ex: the group tree:
 * 			|-admin
 * 			|	|-publisher
 * 			|		|-poster
 * 			|		|-eidtor
 * 			|
 * 			|-user
 * 			|-gest
 */

/*
 * 	Auction: the group tree:
 * 			|-admin
 * 			|
 * 			|-paymentMember
 * 			|	|-freeMember
 * 			|		|-buyer
 * 			|
 * 			|-guest
 */
//////////////////////////////////////////////////////////////////
// BEGIN for above tree

define ( "GROUP_ADMIN", "admin" );
define ( "GROUP_PAYMENT_MEMBER", "paymentmember" );
define ( "GROUP_FREE_MEMBER", "freemember" );
define ( "GROUP_BUYER", "buyer" );
define ( "GROUP_EVERY_ONE", "*" );

$adminGroup = new UserGroup ( "Administrator", GROUP_ADMIN );
UserAccessFactory::addUserGroup ($adminGroup);

$paymentMember = new UserGroup ( "Payment Member", GROUP_PAYMENT_MEMBER );
$freeMember = new UserGroup ( "Free Member", GROUP_FREE_MEMBER );
$buyer = new UserGroup ( "Buyer", GROUP_BUYER );

$freeMember->addChildGroup($buyer);
$paymentMember->addChildGroup($freeMember);
UserAccessFactory::addUserGroup ($paymentMember );


/*define ( "GROUP_ADMIN", "admin" );
define ( "GROUP_GOLD_MEMBER", "goldmember" );
define ( "GROUP_SLIVER_MEMBER", "slivermember" );
define ( "GROUP_MEMBER", "member" );
define ( "GROUP_EVERY_ONE", "*" );
$adminGroup = new UserGroup ( "Administrator", GROUP_ADMIN );
UserAccessFactory::addUserGroup ( $adminGroup );

$goldMember = new UserGroup ( "Gold Member", GROUP_GOLD_MEMBER );
$sliverMember = new UserGroup ( "Silver Member", GROUP_SLIVER_MEMBER );
$member = new UserGroup ( "Member", GROUP_MEMBER );
$sliverMember->addChildGroup($member);
$goldMember->addChildGroup($sliverMember);
UserAccessFactory::addUserGroup ( $goldMember );
*/
//UserAccessFactory::addUserGroup ( $sliverMember );
//UserAccessFactory::addUserGroup ( $member );
// END demo for above tree
//////////////////////////////////////////////////////////////////





?>